<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\StoreCategory
 *
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StoreCategory newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StoreCategory newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StoreCategory query()
 * @mixin \Eloquent
 * @property int $id
 * @property string $name 名称
 * @property int $parent_id 上级ID
 * @property int $sort 排序
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StoreCategory whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StoreCategory whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StoreCategory whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StoreCategory whereParentId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StoreCategory whereSort($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\StoreCategory whereUpdatedAt($value)
 */
class StoreCategory extends Model
{
    protected $table = 'store_category';
    protected $guarded=[];

    public function stores()
    {
        $this->hasMany(Store::class, 'category_id', 'id');
    }
}
